﻿@{
    ViewBag.Title = "文档下载";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@section HeaderContent
{
<style>
    #downloadArea {
        padding: 50px;
    }

        #downloadArea p {
            line-height: 120%;
        }

        #downloadArea h2 {
            font-size: 200%;
            font-weight: bold;
            text-align: center;
            margin-bottom: 20px;
        }

        #downloadArea img {
            width: 200px;
            margin: 20px;
        }

        #downloadArea .versionSelector-title {
            font-weight: bold;
            margin: 10px;
        }

        #downloadArea .qrcode {
            text-align: center;
            font-size: 120%;
        }

            #downloadArea .qrcode table thead td {
                font-weight: bold;
            }

            #downloadArea .qrcode table tbody {
                text-align: left;
            }


            #downloadArea .qrcode table {
                margin: 0px auto;
            }

                #downloadArea .qrcode table td {
                    vertical-align: top;
                    padding: 5px;
                }

    #downloadTip {
        text-align: center;
        display: none;
        padding: 20px;
        background: rgb(255, 245, 210);
    }

    .bookNote {
        text-align: center;
    }

    #downloadArea .bookNote p {
        line-height: 150%;
        font-size: 1.4em;
    }

    #downloadArea .bookNote img {
        width: 400px;
    }

    .bookNote a {
        font-size: 150%;
        padding: 15px 30px;
    }

    .clear {
        clear: both;
        overflow: hidden;
    }

    .line {
        margin-top: 40px;
        margin-bottom: 40px;
    }
</style>
<script>
    var guid = '@ViewData["Guid"]';
    var interval;
    $(function() {

        $('input[name=version]').eq(0).attr('checked', true);

        interval = setInterval(function() {
                $.ajax({
                    type: 'POST',
                    url: '@Url.Action("CheckDownload")',
                    data: {
                        guid: guid,
                        version: $("input[name='version']:checked").val(),
                        versionWeb: $("input[name='versionWeb']:checked").val()
                    },
                    dataType: "json",
                    success: function(json) {
                        if (json.success) {
                            //开始下载
                            clearInterval(interval);
                            $('#downloadTip').show();
                            $('#versionSelector').hide();
                            location.href = $('#downloadTip a').attr('href');
                        }
                    }
                });
            },
            5000);
    });
</script>
}
<div class="wrapper">
    <div id="downloadArea">
        @*<h2>
            Senparc.Weixin SDK 官方微信开发教程<br />
            <br />
            《微信开发深度解析：公众号、小程序高效开发秘籍》
            </h2>


            <div class="bookNote">
            <p>
            历经2年精心雕琢，难得的“理论 + 实战案例 + 趟坑经验”总结，
            </p>
            <p>
            从需求分析、策划，到账号申请、验证，再到全面的 API 及开发工具，
            </p>
            <p>
            覆盖所有开发微信公众号（含订阅号、服务号和小程序）所需关键技能！
            </p>
            </div>

            <div class="bookNote">
            <img src="/images/book-cover-front-small-3d.png"><br /><br />
            <a href="https://book.weixin.senparc.com/book/link?code=sdk-doc-download" class="application" target="_blank">购买正版</a>
            </div>

            <div class="line"></div>*@
        <h2 id="doc-download">下载DLL程序集说明文档</h2>
        <div class="qrcode">
            <div class="versionSelector-title">帮助文档已累计下载 @ViewData["DownloadCount"] 次</div>
            <p>&nbsp;</p>

            <div id="versionSelector">
                <div class="versionSelector-title">第一步：请选择下载版本：</div>

                <table>
                    <thead>
                        <tr>
                            <td><h3>.chm帮助文档</h3></td>
                            <td><h3>网页版帮助文档：</h3></td>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td>
                                @foreach (var version in ViewData["Versions"] as List<string>)
                                {
                                    <p>
                                        <label for="@version.Replace(".", "_")"><input id="@version.Replace(".", "_")" value="@version" type="radio" name="version" />v@(version)</label>
                                    </p>
                                }
                            </td>
                            <td>
                                @foreach (var version in ViewData["WebVersions"] as List<string>)
                                {
                                    <p>
                                        <label for="W@(version.Replace(".", "_"))"><input id="W@(version.Replace(".", "_"))" value="W@(version)" type="radio" name="version" />v@(version)</label>
                                    </p>
                                }
                            </td>
                        </tr>
                    </tbody>
                </table>

                <div class="versionSelector-title">
                    <p>
                        第二步：请用微信扫描下方二维码，进入公众号，<br />

                        即可自动开始下载类库帮助文档+网页版源码<br />
                        <img src="@ViewData["QrCodeUrl"]" />
                    </p>
                </div>
            </div>
            <div id="downloadTip">
                <p>
                    审核通过，下载已开始，如果10秒内没有开始下载，请 @Html.ActionLink("点击这里", "Download", new { guid = ViewData["Guid"] }, new { target = "_blank", id = "linkDownload" }) 下载。
                </p>
                <p>如果您需要重新下载，请刷新此页面。</p>
            </div>
        </div>

        <div id="doc-online" class="line"></div>
        <h2>程序集在线文档</h2>
        <div class="qrcode">
            <p>
                <a href="http://doc.weixin.senparc.com" target="_blank" class="document_help application">查看在线帮助文档</a>
            </p>
        </div>

        <div id="api-swagger-online" class="line"></div>
        <h2>API Swagger 在线文档</h2>
        <div class="qrcode">
            <p>
                <a href="https://www.ncf.pub/swagger/index.html?urls.primaryName=WeChat_OfficialAccount" target="_blank" class="document_help application">公众号（Senparc.Weixin.MP）</a>
                &nbsp; &nbsp; &nbsp;
                <a href="https://www.ncf.pub/swagger/index.html?urls.primaryName=WeChat_MiniProgram" target="_blank" class="document_help application">小程序（Senparc.Weixin.WxOpen）</a>
            </p>
            <p>&nbsp;</p>
            <p>&nbsp;</p>
            <p>
                <a href="https://www.ncf.pub/swagger/index.html?urls.primaryName=WeChat_Work" target="_blank" class="document_help application">企业微信（Senparc.Weixin.Work）</a>
                &nbsp; &nbsp; &nbsp;
                <a href="https://www.ncf.pub/swagger/index.html?urls.primaryName=WeChat_Open" target="_blank" class="document_help application">开放平台（Senparc.Weixin.Open）</a>
            </p>

            <p>&nbsp;</p>
            <p>&nbsp;</p>
                <a href="https://www.cnblogs.com/szw/p/WebApiEngine.html" target="_blank" class="document_help application">&gt;了解动态 API&lt;</a>
        </div>


        <div id="doc-online-source-code" class="line"></div>
        <h2>在线文档源代码</h2>
        <div class="qrcode">
            <p>
                <a href="https://github.com/JeffreySu/WeixinResource/tree/master/SDK%E6%96%87%E6%A1%A3/C%23" target="_blank" class="document_help application">查看在线文档源代码</a>
            </p>
        </div>
    </div>
    <div class="clear"></div>
</div>
